package com.haidada.tk.utils;



import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 唯一id工具
 */
public class IdUtils {


    public static Long getId() {
        long id = IdUtils.getUID();
        if (id < 0L) {
            id = -id;
        }
        return id;
    }

    private static long getUID(){
        SimpleDateFormat sdf = new SimpleDateFormat("yyMMddHHmm");
        System.out.println(sdf.format(new Date()));
        String Ip = WebUtils.getIp();
        Ip = Ip.replace(":","");
        Ip = Ip.replace(".","");
        return Long.parseLong(sdf.format(new Date()) + Ip);
    }
}